1. Field of the Invention
The present invention relates to an imaging apparatus, and more specifically to an imaging apparatus having the function of estimating the kind of a light source used in the capture of an input image, and a processing method thereof and a program for causing a computer to execute the method.
2. Description of the Related Art
The human eye has a function called chromatic adaptation whereby it perceives a white object as being white even when there is a change in light source. This function allows the human to perceive a white object as being white even through a change occurs in the spectral distribution of a light source depending on the sun's altitude. It is due to this color adaptation function that a white object can be perceived as being white even under a fluorescent lamp whose spectral distribution completely differs from that of sunlight. The “white balance function” attempts to realize such a function in an apparatus.
There are cases where, even when a white object can be seen as white by means of the white balance function, due to the influence of differences between the “spectral sensitivity of an image sensor” and the “spectral sensitivity of the human eye”, a color may not be reproduced as it looks. A function called “color reproduction function” is provided as a function for correcting this situation. Since the parameters for the “white balance function” and “color reproduction function” are represented in matrix form, at the implementation stage, these are sometimes combined into single processing in a single matrix.
To realize the white balance function, on the basis of the Evan's theory (gray world hypothesis), an algorithm for effecting overall control in combination with blackbody radiation locus information has been commonly used. The Evans' theory is a hypothesis stating that the sum of the colors of the subjects in the world is gray. Further, the black body radiation locus refers to the locus of a color changing from gold bronze, red, orange, yellow, green, and blue emitted from a perfect blackbody upon heating the black body. Since natural light is generally on the blackbody radiation locus, the blackbody radiation locus is used as a reference when handling color information of natural light.
However, the Evan's theory may not hold true under conditions in which the integral of all the effective pixels in a screen does not result in gray, as in the case of scenes with the sky imaged on the entire screen or scenes surrounded by trees. For instance, in the case of scenes with the sky imaged on the entire screen, performing control under the assumption that the Evans' theory holds true may result in erroneous light source estimation.
In view of this, as a high-accuracy light source estimation method, an estimation method using a specular component (hereinafter, referred to as the specular method) has been proposed in the related art. According to this specular method, by drawing attention to the fact that the reflectance of an object is divided into two components, a diffuse reflection component (material component) for reflecting each color by the inherent spectral reflectance of the object and a specular reflection component (specular component) that does not depend on the color of the object, objects that are equal in material component are grouped together and a plane is generated in color space for each individual group. Then, the vector in the direction of intersection of the respective planes thus generated is outputted as a specular component (that is, as the spectral energy distribution of a light source) (see, for example, Shoji Tominaga, Brian A. Wandell, “Standard surface-reflectance model and light source estimation”, Journal of Optical Society of America, Vol. 6, No. 4, April 1989, p. 576-584).